package com.oxygen.design.singleton.bean;

/**
 * @author wangjie
 * @title: SingleObjectStatic
 * @description: 登记式/静态内部类
 * @date 2022/3/30 10:01
 **/
public class SingleObjectStatic {

    private SingleObjectStatic() {
    }

    public static final SingleObjectStatic getInstance() {
        return SingletonHolder.INSTANCE;
    }

    public void showMessage() {
        System.out.println("Hello World!");
    }

    private static class SingletonHolder {
        private static final SingleObjectStatic INSTANCE = new SingleObjectStatic();
    }
}
